package com.igeek.base.ch0712.Demo3;

/**
 * @Description TODO
 * @Author chenmin
 * @Date 2024/7/14 13:30
 */
public class Circle extends Shape{
    private double radius;

    public Circle(double radius) {
        this.radius = radius;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return Math.PI*getRadius()*getRadius();
    }

    @Override
    public double getSize() {
        return 2*Math.PI*getRadius();
    }

    @Override
    public String toString() {
        return "Circle{" + "半径=" + getRadius() + '}';
    }
}
